package cn.edu.tju.elm.mapper;

import cn.edu.tju.core.model.WalletRule;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface WalletRuleMapper extends BaseMapper<WalletRule> {
    
    @Select("SELECT * FROM t_wallet_rule WHERE rule_type = #{ruleType} AND is_active = 1 ORDER BY priority DESC")
    List<WalletRule> selectActiveRulesByType(@Param("ruleType") String ruleType);
}